<!DOCTYPE html>
<html lang="en">
<head>
    <#include "/commonPage.html" />
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:90px;">
    <div><h1 style="color:#133ad5">添加订单</h1></div>
    <div>
        <HR width="100%" color=#133ad5 SIZE=1>
    </div>
</div>
<div data-options="region:'center',border:false" style="padding:0">
    <form id="ff" method="post" style="width: 500px;margin: 0 auto;" enctype="multipart/form-data">
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="billName" style="width:100%"
                   data-options="label:'名称:',labelPosition:'left',labelWidth:100,prompt:'输入订单的名称',required:true">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="specification" style="width:100%"
                   data-options="label:'规格:',labelPosition:'left',labelWidth:100,prompt:'输入规格'">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="paper" style="width:100%"
                   data-options="label:'纸张/材质:',labelPosition:'left',labelWidth:100,prompt:'输入纸张/材质'">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="technology" style="width:100%"
                   data-options="label:'工艺:',labelPosition:'left',labelWidth:100,prompt:'输入工艺'">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-textbox" name="quantity" style="width:100%"
                   data-options="label:'数量:',labelPosition:'left',labelWidth:100,prompt:'输入数量'">
        </div>
        <div style="margin-bottom:20px">
            <input id="price" class="easyui-textbox" name="unitPrice" style="width:100%"
                   data-options="label:'单价:',labelPosition:'left',labelWidth:100,prompt:'输入单价'">
        </div>
        <div style="margin-bottom:20px">
            <input id="total" class="easyui-textbox" name="totalMoney" style="width:100%"
                   data-options="label:'总金额:',labelPosition:'left',labelWidth:100,prompt:'输入总金额',required:true">
        </div>
        <div style="margin-bottom:20px">
            <input id="received" class="easyui-textbox" name="received" value="0" style="width:100%"
                   data-options="label:'已收款:',labelPosition:'left',labelWidth:100,prompt:'输入已收款'">
        </div>
        <div style="margin-bottom:20px">
            <label class="textbox-label textbox-label-left"
                   style="text-align: left; width: 100px; height: 30px; line-height: 30px;">提交时间:</label>
            <input type="date" class="easyui-textbox" name="otime" style="width:50%" data-options="required:true">
        </div>
        <div style="margin-bottom:20px">
            <label class="textbox-label textbox-label-left"
                   style="text-align: left; width: 100px; height: 30px; line-height: 30px;">预计完成时间:</label>
            <input type="date" class="easyui-textbox" name="ctime" style="width:50%" data-options="required:true">
        </div>
        <div style="margin-bottom:20px">
            <label class="textbox-label textbox-label-left"
                   style="text-align: left; width: 100px; height: 30px; line-height: 30px;">图片:</label>
            <input id="picturePath" name="picturePath" class="easyui-filebox" style="width:500px"
                   data-options="buttonText:'选择文件',buttonIcon:'icon-folderadd'">
        </div>
    </form>
    <div style="width: 500px;margin: 30px auto 0 auto;" align="center">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)"
           onclick="addBusinessfunction()" style="width:80px;margin-right: 50px;">保存</a>
        <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)"
           onclick="cleartext()" style="width:80px">清除</a>
    </div>
</div>
</body>
<script>
    function cleartext() {
        $('#ff').form('clear');
        $('#mycombobox').combobox('reload');
    };

    function addBusinessfunction() {
        $('#ff').form('submit', {
            url: '/order/addb',
            onSubmit: function () {
                var isValid = $(this).form('validate');
                if (!isValid) {
                    $.messager.progress('close');	// hide progress bar while the form is invalid
                } else {

                }
                return isValid;
            },
            success: function (data) {
                if (data == "成功") {
                    $.messager.alert('Info', data, 'info');
                    //$('#ff').form('clear');
                } else {
                    $.messager.alert('错误', data, 'error');
                }
            }
        })
    };
</script>
</html>